﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DLL
{
    public class ShopRepo
    {
        public List<Shop> GetAll()
        {
            using (RetailManagementEntities dbContext = new RetailManagementEntities())
            {
                return dbContext.Shops.OrderBy(x => x.Name).ToList();
            }
        }

        public Shop GetById(int id)
        {
            using (RetailManagementEntities dbContext = new RetailManagementEntities())
            {
                return dbContext.Shops.Find(id);
            }
        }
    }
}
